package com.zkthink.ceres.file.entity;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

/**
 * <p>
 * 实体类 素材标签表
 * </p>
 *
 * @author kellen
 * @since 2020-05-28
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_attachment_tag")
@ApiModel(value = "AttachmentTag", description = "素材标签表")
@AllArgsConstructor
public class AttachmentTag extends Entity<Long> {

  private static final long serialVersionUID = 1L;

  /**
   * 标签名称
   */
  @ApiModelProperty(value = "标签名称")
  @Length(max = 100, message = "标签名称长度不能超过100")
  @TableField(value = "name", condition = LIKE)
  @Excel(name = "标签名称")
  private String name;


  @Builder
  public AttachmentTag(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser,
      Long updateUser,
      String name) {
    this.id = id;
    this.createTime = createTime;
    this.updateTime = updateTime;
    this.createUser = createUser;
    this.updateUser = updateUser;
    this.name = name;
  }

}
